<template>
  <div>
    <div class="one">
      <!-- <div class="seconds">{{ count }}s后将自动跳转到登录页！</div> -->
      <!-- <div class="seconds">{{ count }}</div> -->
      <div class="catbox">
        <img src="./imges/cat.png" alt="" />
      </div>
      <p>萌度show</p>
    </div>
    <div>
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      count: "", //倒计时
    };
  },

  created() {
    this.threeGo();
  },

  methods: {
    //1秒后进入跳转页面
    threeGo() {
      const TIME_COUNT = 1;
      if (!this.timer) {
        this.count = TIME_COUNT;
        this.show = false;
        this.timer = setInterval(() => {
          if (this.count > 0 && this.count <= TIME_COUNT) {
            this.count--;
          } else {
            this.show = true;
            clearInterval(this.timer);
            this.timer = null;
            //跳转的页面写在此处
            this.$router.push({
              path: "two ",
            });
          }
        }, 1000);
      }
    },
  },
};
</script>

<style lang='less' scoped>
* {
  margin: 0;
  padding: 0;
}
// .seconds {
//   width: 200px;
//   height: 40px;
//   padding-top: 20px;
//   padding-left: 10px;
//   border-radius: 10px;
//   position: relative;
//   left: 180px;
//   top: 20px;
//   color: pink;
//   background-color: rgb(111, 177, 235);
// }
.one {
  background-color: #ff8c00;
  width: 100%;
  height: 667px;

  .catbox {
    // position: absolute;
    // display: flex;
    // margin-left: 36%;

    margin-left: 12px;
    width: 350px;
    // background-color: red;
    align-items: center;
  }

  p {
    text-align: center;
    color: white;
    font-size: 50px;
    margin-top: -200px;
  }
}
</style>
